import request from '../utils/request';

/**
 * 校内点评
 * @param {*} schoolId
 * @param {*} data
 */
export async function getInnerRemarkList(schoolId, data) {
  return request({
    url: `/comment/listBySchoolId/${schoolId}`,
		method: 'GET',
		data
  })
}
/**
 * 校外点评
 * @param {} data
 */
export async function getOutterRemarkList(schoolId, data) {
    return request({
    url: `/comment/listOutBySchoolId/${schoolId}`,
        method: 'GET',
        data
    })
  }
/**
 * 点赞
 * @param {} data
 */
export async function dianzan(data) {
  return request({
    url: `/dianZan/save`,
		method: 'POST',
		header: 'application/json',
		data
  })
}
/**
 * 删除点赞
 * @param {*} data
 */
export async function notLike(data) {
    return request({
      url: `/dianZan/delete`,
          method: 'DELETE',
          data
    })
}
/**
 * 根据id查询美食点评详情
 */
export async function getDetail(data) {
  return request({
    url: `/comment/list/{id}`,
		method: 'GET',
		data
  })
}


/**
 * 获取详情页下的评论
 */
export async function getComments(data) {
	return request({
		url: `/pingLun/getList`,
			method: 'GET',
			data
	})
}

export async function addByFoodContent(data) {
  return request({
    url: `/comment/addByFoodContent`,
    method: 'POST',
    data
  })
}

export async function addByFoodId(data) {
  return request({
    url: `/comment/addByFoodId`,
    method: 'POST',
    data
  })
}

/**
 * 在点评详情页添加评论
 */
export async function addComment(data) {
  return request({
    url: `/pingLun/save`,
    method: 'POST',
		header: 'application/json',
    data
  })
}
/**
 * 查询我的点评
 */
export async function getMyRemark(data) {
  return request({
    url: `/comment/listByUser/{id}`,
    method: 'GET',
    data
  })
}